import React, { Component } from 'react'
import styles from './index.module.scss'
import nav1 from 'assets/nav-1.png'
import nav2 from 'assets/nav-2.png'
import nav3 from 'assets/nav-3.png'
import nav4 from 'assets/nav-4.png'
export default class Navbar extends Component {
  render() {
    const navs = [
      {
        id: 1,
        title: '整租',
        path: '/home',
        img: nav1,
      },
      {
        id: 2,
        title: '合租',
        path: '/home',
        img: nav2,
      },
      {
        id: 3,
        title: '地图找房',
        path: '/home',
        img: nav3,
      },
      {
        id: 4,
        title: '去出租',
        path: '/home',
        img: nav4,
      },
    ]
    return (
      <ul className={styles.NavbarCom}>
        {navs.map((item) => (
          <li key={item.id} onClick={() => this.props.history.push(item.path)}>
            <img src={item.img} alt="" />
            <span>{item.title}</span>
          </li>
        ))}
      </ul>
    )
  }
}
